<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style></style>
  </head>
  <body>
    <script>
      function CreateStu(name, id, sex, grade) {
        this.name = name;
        this.id = id;
        this.sex = sex;
        this.grade = grade;
        this.sayHi();
      }
      CreateStu.prototype = {
        sayHi() {
          console.log(
            `你好我是${this.name},学号${this.id},${this.sex},${this.grade}年级`
          );
        },
      };

      var man = new CreateStu("可可", "12345", "男", "2");
    </script>
  </body>
</html>
